package stockblaster.client;

public class StockShares {
	private String companyName;
	private int sharesTotal;
	
	public StockShares(String cName, int sTotal) {
		companyName = cName;
		sharesTotal = sTotal;
	}
	
	/**
	 * Method to get the company name
	 * @return the company name
	 */
	public String getCompanyName() {
		return companyName;
	}
	
	/**
	 * Method to get the sharesTotal
	 * @return the shares total in a company
	 */
	public int getSharesTotal() {
		return sharesTotal;
	}
	
	/**
	 * Method to add the shares owned
	 * @param a number of shares to be added
	 * @return the updated shares total
	 */
	public int addShare(int a) {
		sharesTotal += a;
		return sharesTotal;
	}
	
	/**
	 * Method to subtract the shares owned
	 * @param a number of shares to be deducted
	 * @return the updated shares total
	 */
	public int subtractShare(int a) {
		sharesTotal -= a;
		return sharesTotal;
	}
	
	/**
	 * Method to set sharesTotal
	 * @param a new number of shares
	 */
	public void setSharesTotal(int a) {
		sharesTotal = a;
	}
}
